import requests
import json

headers = {
    "content-type": "application/json;charset=UTF-8",
    "referer": "https://news.qq.com/",
    "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
}
count = 0
url = "https://i.news.qq.com/web_feed/getHotModuleList"
page = 0
while True:
    page += 1
    data = {
        "base_req": {
            "from": "pc"
        },
        "forward": "2",
        "flush_num": page,
        "channel_id": "news_news_top",
        "item_count": 20
    }
    data = json.dumps(data, separators=(',', ':'))
    response = requests.post(url, headers=headers, data=data)
    count += 1
    print(response.text)
    print(f"第{count}次请求", response)
